Remove Commons Lang 2 usage#2023
Open
gbhat618 wants to merge 2 commits into
Open
Conversation
Jenkins core is dropping commons-lang:2.6 (jenkinsci/jenkins#26905); replace all 16 affected source files with plain Java 21 equivalents. No new library dependencies introduced — every call replaced with a JDK 21 idiom. The one double-getter (EC2SSHLauncher.getOfflineCauseReason()) is cached in a local to satisfy the SpotBugs NP_NULL rule. Regression guard added to pom.xml: <ban-commons-lang-2.skip>false</ban-commons-lang-2.skip>. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
gbhat618
marked this pull request as ready for review
July 15, 2026 10:48
apuig
reviewed
Jul 15, 2026
apuig
left a comment
Contributor
There was a problem hiding this comment.
Thanks for the thoughtful cleanup.
I’m waiting for your comments on deleteWhitespace before approving.
Comment on lines
-148
to
+147
| byte[] cipherText = Base64.getDecoder().decode(StringUtils.deleteWhitespace(encodedPassword)); | ||
| byte[] cipherText = Base64.getDecoder().decode(encodedPassword.replaceAll("\\s+", "")); |
Contributor
There was a problem hiding this comment.
noticed the impl of deleteWhitespace is quite different than a regex replacement. I'm tempted to suggest inlining ~15LoC to avoid surprises
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jenkins core is removing commons-lang2 dependency - jenkinsci/jenkins#26105. This project is using lang2 transitively, needing to drop those usages. Instead of migrating and depending on commons-lang3-api, due to the simple usages, this PR migrates to JDK apis.
Testing